import request from '/@/utils/request';

/**
* ${tableComment}
* ${FunctionName}
*/
export function ${functionName}Api() {
    return {
        list: (params?: object)=> {
            return request({
                url: import.meta.env.VITE_APP_BASE_API+'/${moduleName}/${functionName}/list',
                method: 'post',
                params
            });
        },
        edit: (params?: object)=> {
            return request({
                url: import.meta.env.VITE_APP_BASE_API+'/${moduleName}/${functionName}',
                method: 'put',
                data: params
            });
        },
        query: (id?: number | string)=> {
            return request({
                url: import.meta.env.VITE_APP_BASE_API+'/${moduleName}/${functionName}/'+id,
                method: 'get'
            });
        },
        insert: (params?: object) => {
            return request({
                url: import.meta.env.VITE_APP_BASE_API+'/${moduleName}/${functionName}',
                method: 'post',
                data: params
            });
        },
        delete: (id?: number | string) => {
            return request({
                url: import.meta.env.VITE_APP_BASE_API+'/${moduleName}/${functionName}/' + id,
                method: 'delete'
            });
        },
    };
}
